Conversation
|
Thanks for opening this pull request! This pull request can be checked-out with: git fetch origin pull/3252/head:pr-3252
git checkout pr-3252This pull request can be installed with: pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3252/head |
Lulalaby
left a comment
There was a problem hiding this comment.
Can someone request changes reminding me to add editing & creating channels with that flag
and whatever else i may have forgotten
Soheab
left a comment
There was a problem hiding this comment.
Needs a way for bots to create this kind of channel
This message was sponsored by toothyfernsan on discord.
|
I tested it with all but MediaChannels since I don't have access to those anywhere, but I'd still like a second pair of testing eyes on this |
|
Also, creating a channel with this turned on isn't possible unfortunately, gotta create + edit |
# Conflicts: # CHANGELOG.md
Signed-off-by: Lala Sabathil <lala@pycord.dev>
Signed-off-by: Lala Sabathil <lala@pycord.dev>
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Lala Sabathil <lala@pycord.dev> Signed-off-by: ToothyDev <55001472+ToothyDev@users.noreply.github.com>
|
Thanks ! |
vmphase
left a comment
There was a problem hiding this comment.
Why does this PR add any kind of support for spoiler on StageChannel, while documentation explicitly says:
IS_SPOILER_CHANNEL... Can be set on all textual guild channels and voice channels (not GUILD_STAGE).
To stay internally consistent, because NSFW also doesn't work on stage channels, but Pycord supports it, it CAN be passed, it just has no effect. And actually, both toggles do exist (and work) in the client UI. Basically, everything works except it having an actual effect on the channel. So, while yes, it doesn't actually do anything, I still think it's worth keeping for internal consistency and because Discord might eventually make it work for stage channels (same for nsfw) |
I see. If the development team is fine with this, sure. |
|
From the docs
Two things:
|
|
the client switches it back. i think the api rejects it |
|
Either they changed the behavior or I remember wrong, but: |
| HTTPException | ||
| Editing the channel failed. | ||
| """ | ||
| if "spoiler" in options: |
There was a problem hiding this comment.
The nsfw docstring says passing nsfw=True to a spoiler channel converts it to NSFW, but this block only runs when spoiler is passed. edit(nsfw=True) alone never clears is_spoiler_channel, so the documented behavior isn't implemented. Either handle nsfw=True independently of spoiler (clear the bit) or drop that sentence from the docstring.
There was a problem hiding this comment.
I just tested this with the current code. Passing nsfw=True to a spoiler channel converts it, and channel.spoiler returns False as expected
There was a problem hiding this comment.
So just to make sure I understand @ToothyDev, spoiler to nsfw implicitly works fine but nsfw to spoiler implicitly fails ?
There was a problem hiding this comment.
Correct. I think this was a dicussion way early in the PR where catching all the specific cases was really complicated and so it was scrapped, since the API doesn't reject it, it just doesn't do anything
There was a problem hiding this comment.
It seems like the only explicitly documented behavior is
Can only be set if channel's
nsfwis false
for spoiler state, and nothing about the other way around. I am not sure however if we should still rely on the API for the rest.
@Lulalaby Do you have some insight maybe ?
|
Will this PR ever merge? xD
|
Summary
This adds
ChannelFlags.is_spoiler_channel(following https://docs.discord.food/resources/channel#channel-flags) as well as a.spoilerproperty to all applicable channel types (all except category). Same goes for making it possible to create these channels via the regular channel creation methods, again with the exception of category channels. Channel editing with this flag is also functional.Now that it's officially documented, here's the ddocs PR: discord/discord-api-docs#8465
Depends on discord/discord-api-docs#8465
Information
examples, ...).
Checklist
type: ignorecomments were used, a comment is also left explaining why.